package com.guigu.tms.manager.controller.wj;

import com.github.pagehelper.PageInfo;
import com.guigu.tms.commons.entity.base.BaseTruckType;
import com.guigu.tms.commons.entity.base.PdGoodsType;
import com.guigu.tms.commons.entity.base.PdTruckType;
import com.guigu.tms.manager.feign.wj.TruckTypeFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/pdTruckType")
public class TruckTypeController {

    @Autowired
    TruckTypeFeignClient truckTypeFeignClient;

    @GetMapping("/ShowPdTruckType")
    public List<PdTruckType> ShowPdTruckTyp(){
        return truckTypeFeignClient.ShowPdTruckType();
    }

    @PostMapping("/BaseTruckTypeList")
    public PageInfo<BaseTruckType> BaseTruckTypeList(@RequestBody Map<String, String> map){
        return truckTypeFeignClient.BaseTruckTypeList(map);
    }

    @GetMapping("/ShowPdGoodsType")
    public List<PdGoodsType> ShowPdGoodsType(){
        return truckTypeFeignClient.ShowPdGoodsType();
    }

    @PostMapping("/AddTruckType")
    public int AddTruckType(@RequestBody PdTruckType pdTruckType){
        return truckTypeFeignClient.AddTruckType(pdTruckType);
    }

    @DeleteMapping("/DeleteTruckTypeById")
    public int DeleteTruckTypeById(@RequestParam int truckTypeId){
        return truckTypeFeignClient.DeleteTruckTypeById(truckTypeId);
    }

    @PutMapping("/UpdateTruckType")
    public int UpdateTruckType(@RequestBody PdTruckType pdTruckType){
        return truckTypeFeignClient.UpdateTruckType(pdTruckType);
    }

    @DeleteMapping("/DeleteGoodsTruck")
    public int DeleteGoodsTruck(@RequestParam int truckTypeId){
        return truckTypeFeignClient.DeleteGoodsTruck(truckTypeId);
    }
}

